package cn.zjitc.quickstart.filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

//@WebFilter("/*")
public class Demo2Filter implements Filter {
    @Override
    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
        //对request对象请求消息增强
        System.out.println("request对象请求消息增强....");
        //放行
        chain.doFilter(req, resp);
        System.out.println("filterDemo2执行了....");
        //对response对象的响应消息增强
        System.out.println("response对象的响应消息增强...");
    }

    public void init(FilterConfig config) throws ServletException {
    }

    public void destroy() {
    }
}
